//
// Created by Administrator on 2023/8/4.
//

#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    vector<int> findArray(vector<int> &pref) {
        vector<int> res{pref[0]};
        for (int i = 1; i < pref.size(); i++) {
            res.push_back(pref[i] xor pref[i - 1]);
        }
        return res;

    }
};

int main() {
    Solution s;
    vector<int> pref = {5, 2, 0, 3, 1};
    vector<int> res = s.findArray(pref);
    for (auto &x: res) cout << x << " ";
    return 0;
}